const BASE = 'http://localhost:8080';
export function request(path, method='GET', data={}){
  return new Promise((resolve,reject)=>{
    wx.request({
      url: BASE + path, method, data,
      header: {'Content-Type':'application/json'},
      success: res=> resolve(res.data),
      fail: err=> reject(err)
    });
  });
}